<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="html/html; charset=utf-8" />
		<title>TMCache Class Reference</title>
		<meta id="xcode-display" name="xcode-display" content="render"/>
		<meta name="viewport" content="width=550" />
		<link rel="stylesheet" type="text/css" href="../css/styles.css" media="all" />
		<link rel="stylesheet" type="text/css" media="print" href="../css/stylesPrint.css" />
		<meta name="generator" content="appledoc 2.1 (build 840)" />
	</head>
	<body>
		<header id="top_header">
			<div id="library" class="hideInXcode">
				<h1><a id="libraryTitle" href="../index.html">TMCache </a></h1>
				<a id="developerHome" href="../index.html">Tumblr</a>
			</div>
			
			<div id="title" role="banner">
				<h1 class="hideInXcode">TMCache Class Reference</h1>
			</div>
			<ul id="headerButtons" role="toolbar">
				<li id="toc_button">
					<button aria-label="Show Table of Contents" role="checkbox" class="open" id="table_of_contents"><span class="disclosure"></span>Table of Contents</button>
				</li>
				<li id="jumpto_button" role="navigation">
					<select id="jumpTo">
	<option value="top">Jump To&#133;</option>
	
	<option value="overview">Overview</option>
	
	
	
	
	<option value="tasks">Tasks</option>
	
	
	
	
	
	<option value="properties">Properties</option>
	
	<option value="//api/name/diskByteCount">&nbsp;&nbsp;&nbsp;&nbsp;diskByteCount</option>
	
	<option value="//api/name/diskCache">&nbsp;&nbsp;&nbsp;&nbsp;diskCache</option>
	
	<option value="//api/name/memoryCache">&nbsp;&nbsp;&nbsp;&nbsp;memoryCache</option>
	
	<option value="//api/name/name">&nbsp;&nbsp;&nbsp;&nbsp;name</option>
	
	<option value="//api/name/queue">&nbsp;&nbsp;&nbsp;&nbsp;queue</option>
	
	
	
	
	
	
	<option value="instance_methods">Instance Methods</option>
	
	<option value="//api/name/initWithName:">&nbsp;&nbsp;&nbsp;&nbsp;- initWithName:</option>
	
	<option value="//api/name/objectForKey:">&nbsp;&nbsp;&nbsp;&nbsp;- objectForKey:</option>
	
	<option value="//api/name/objectForKey:block:">&nbsp;&nbsp;&nbsp;&nbsp;- objectForKey:block:</option>
	
	<option value="//api/name/removeAllObjects">&nbsp;&nbsp;&nbsp;&nbsp;- removeAllObjects</option>
	
	<option value="//api/name/removeAllObjects:">&nbsp;&nbsp;&nbsp;&nbsp;- removeAllObjects:</option>
	
	<option value="//api/name/removeObjectForKey:">&nbsp;&nbsp;&nbsp;&nbsp;- removeObjectForKey:</option>
	
	<option value="//api/name/removeObjectForKey:block:">&nbsp;&nbsp;&nbsp;&nbsp;- removeObjectForKey:block:</option>
	
	<option value="//api/name/setObject:forKey:">&nbsp;&nbsp;&nbsp;&nbsp;- setObject:forKey:</option>
	
	<option value="//api/name/setObject:forKey:block:">&nbsp;&nbsp;&nbsp;&nbsp;- setObject:forKey:block:</option>
	
	<option value="//api/name/sharedCache">&nbsp;&nbsp;&nbsp;&nbsp;- sharedCache</option>
	
	<option value="//api/name/trimToDate:">&nbsp;&nbsp;&nbsp;&nbsp;- trimToDate:</option>
	
	<option value="//api/name/trimToDate:block:">&nbsp;&nbsp;&nbsp;&nbsp;- trimToDate:block:</option>
	
	
	
</select>
				</li>
			</ul>
		</header>
		<nav id="tocContainer" class="isShowingTOC">
			<ul id="toc" role="tree">
				
<li role="treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#overview">Overview</a></span></li>




<li role="treeitem" id="task_treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#tasks">Tasks</a></span><ul>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Core">Core</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Initialization">Initialization</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Asynchronous Methods">Asynchronous Methods</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Synchronous Methods">Synchronous Methods</a></span></li>
	
</ul></li>





<li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#properties">Properties</a></span><ul>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/diskByteCount">diskByteCount</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/diskCache">diskCache</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/memoryCache">memoryCache</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/name">name</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/queue">queue</a></span></li>
	
</ul></li>





<li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#instance_methods">Instance Methods</a></span><ul>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/initWithName:">initWithName:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/objectForKey:">objectForKey:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/objectForKey:block:">objectForKey:block:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/removeAllObjects">removeAllObjects</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/removeAllObjects:">removeAllObjects:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/removeObjectForKey:">removeObjectForKey:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/removeObjectForKey:block:">removeObjectForKey:block:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/setObject:forKey:">setObject:forKey:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/setObject:forKey:block:">setObject:forKey:block:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/sharedCache">sharedCache</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/trimToDate:">trimToDate:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/trimToDate:block:">trimToDate:block:</a></span></li>
	
</ul></li>


			</ul>
		</nav>
		<article>
			<div id="contents" class="isShowingTOC" role="main">
				<a title="TMCache Class Reference" name="top"></a>
				<div class="main-navigation navigation-top">
					<ul>
	<li><a href="../index.html">Index</a></li>
	<li><a href="../hierarchy.html">Hierarchy</a></li>
</ul>
				</div>
				<div id="header">
					<div class="section-header">
						<h1 class="title title-header">TMCache Class Reference</h1>
					</div>		
				</div>
				<div id="container">	
					
					<div class="section section-specification"><table cellspacing="0"><tbody>
						<tr>
	<td class="specification-title">Inherits from</td>
	<td class="specification-value">NSObject</td>
</tr><tr>
	<td class="specification-title">Declared in</td>
	<td class="specification-value">TMCache.h</td>
</tr>
						</tbody></table></div>
					
					
					
					
					<div class="section section-overview">
						<a title="Overview" name="overview"></a>
						<h2 class="subtitle subtitle-overview">Overview</h2>
						<p><code>TMCache</code> is a thread safe key/value store designed for persisting temporary objects that are expensive to
reproduce, such as downloaded data or the results of slow processing. It is comprised of two self-similar
stores, one in memory (<a href="../Classes/TMMemoryCache.html">TMMemoryCache</a>) and one on disk (<a href="../Classes/TMDiskCache.html">TMDiskCache</a>).</p>

<p><code>TMCache</code> itself actually does very little; its main function is providing a front end for a common use case:
a small, fast memory cache that asynchronously persists itself to a large, slow disk cache. When objects are
removed from the memory cache in response to an &ldquo;apocalyptic&rdquo; event they remain in the disk cache and are
repopulated in memory the next time they are accessed. <code>TMCache</code> also does the tedious work of creating a
dispatch group to wait for both caches to finish their operations without blocking each other.</p>

<p>The parallel caches are accessible as public properties (<a href="#//api/name/memoryCache">memoryCache</a> and <a href="#//api/name/diskCache">diskCache</a>) and can be manipulated
separately if necessary. See the docs for <a href="../Classes/TMMemoryCache.html">TMMemoryCache</a> and <a href="../Classes/TMDiskCache.html">TMDiskCache</a> for more details.</p>
					</div>
					
					
					
					
					
					<div class="section section-tasks">
						<a title="Tasks" name="tasks"></a>
						<h2 class="subtitle subtitle-tasks">Tasks</h2>
						
						
						<a title="Core" name="task_Core"></a>
						<h3 class="subsubtitle task-title">Core</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/name">&nbsp;&nbsp;name</a></code>
		<span class="tooltip"><p>The name of this cache, used to create the <a href="#//api/name/diskCache">diskCache</a> and also appearing in stack traces.</p></span>
	</span>
	<span class="task-item-suffix">property</span>
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/queue">&nbsp;&nbsp;queue</a></code>
		<span class="tooltip"><p>A concurrent queue on which blocks passed to the asynchronous access methods are run.</p></span>
	</span>
	<span class="task-item-suffix">property</span>
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/diskByteCount">&nbsp;&nbsp;diskByteCount</a></code>
		<span class="tooltip"><p>Synchronously retrieves the total byte count of the <a href="#//api/name/diskCache">diskCache</a> on the shared disk queue.</p></span>
	</span>
	<span class="task-item-suffix">property</span>
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/diskCache">&nbsp;&nbsp;diskCache</a></code>
		<span class="tooltip"><p>The underlying disk cache, see <a href="../Classes/TMDiskCache.html">TMDiskCache</a> for additional configuration and trimming options.</p></span>
	</span>
	<span class="task-item-suffix">property</span>
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/memoryCache">&nbsp;&nbsp;memoryCache</a></code>
		<span class="tooltip"><p>The underlying memory cache, see <a href="../Classes/TMMemoryCache.html">TMMemoryCache</a> for additional configuration and trimming options.</p></span>
	</span>
	<span class="task-item-suffix">property</span>
	
</li>
						</ul>
						
						
						<a title="Initialization" name="task_Initialization"></a>
						<h3 class="subsubtitle task-title">Initialization</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/sharedCache">&ndash;&nbsp;sharedCache</a></code>
		<span class="tooltip"><p>A shared cache.</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/initWithName:">&ndash;&nbsp;initWithName:</a></code>
		<span class="tooltip"><p>The designated initializer. Multiple instances with the same name are allowed and can safely access
the same data on disk thanks to the magic of seriality. Also used to create the <a href="#//api/name/diskCache">diskCache</a>.</p></span>
	</span>
	
	
</li>
						</ul>
						
						
						<a title="Asynchronous Methods" name="task_Asynchronous Methods"></a>
						<h3 class="subsubtitle task-title">Asynchronous Methods</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/objectForKey:block:">&ndash;&nbsp;objectForKey:block:</a></code>
		<span class="tooltip"><p>Retrieves the object for the specified key. This method returns immediately and executes the passed
block after the object is available, potentially in parallel with other blocks on the <a href="#//api/name/queue">queue</a>.</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/setObject:forKey:block:">&ndash;&nbsp;setObject:forKey:block:</a></code>
		<span class="tooltip"><p>Stores an object in the cache for the specified key. This method returns immediately and executes the
passed block after the object has been stored, potentially in parallel with other blocks on the <a href="#//api/name/queue">queue</a>.</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/removeObjectForKey:block:">&ndash;&nbsp;removeObjectForKey:block:</a></code>
		<span class="tooltip"><p>Removes the object for the specified key. This method returns immediately and executes the passed
block after the object has been removed, potentially in parallel with other blocks on the <a href="#//api/name/queue">queue</a>.</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/trimToDate:block:">&ndash;&nbsp;trimToDate:block:</a></code>
		<span class="tooltip"><p>Removes all objects from the cache that have not been used since the specified date. This method returns immediately and
executes the passed block after the cache has been trimmed, potentially in parallel with other blocks on the <a href="#//api/name/queue">queue</a>.</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/removeAllObjects:">&ndash;&nbsp;removeAllObjects:</a></code>
		<span class="tooltip"><p>Removes all objects from the cache.This method returns immediately and executes the passed block after the
cache has been cleared, potentially in parallel with other blocks on the <a href="#//api/name/queue">queue</a>.</p></span>
	</span>
	
	
</li>
						</ul>
						
						
						<a title="Synchronous Methods" name="task_Synchronous Methods"></a>
						<h3 class="subsubtitle task-title">Synchronous Methods</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/objectForKey:">&ndash;&nbsp;objectForKey:</a></code>
		<span class="tooltip"><p>Retrieves the object for the specified key. This method blocks the calling thread until the object is available.</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/setObject:forKey:">&ndash;&nbsp;setObject:forKey:</a></code>
		<span class="tooltip"><p>Stores an object in the cache for the specified key. This method blocks the calling thread until the object has been set.</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/removeObjectForKey:">&ndash;&nbsp;removeObjectForKey:</a></code>
		<span class="tooltip"><p>Removes the object for the specified key. This method blocks the calling thread until the object
has been removed.</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/trimToDate:">&ndash;&nbsp;trimToDate:</a></code>
		<span class="tooltip"><p>Removes all objects from the cache that have not been used since the specified date.
This method blocks the calling thread until the cache has been trimmed.</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/removeAllObjects">&ndash;&nbsp;removeAllObjects</a></code>
		<span class="tooltip"><p>Removes all objects from the cache. This method blocks the calling thread until the cache has been cleared.</p></span>
	</span>
	
	
</li>
						</ul>
						
					</div>
					
					
					
					
					
					<div class="section section-methods">
						<a title="Properties" name="properties"></a>
						<h2 class="subtitle subtitle-methods">Properties</h2>
						
						<div class="section-method">
	<a name="//api/name/diskByteCount" title="diskByteCount"></a>
	<h3 class="subsubtitle method-title">diskByteCount</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Synchronously retrieves the total byte count of the <a href="#//api/name/diskCache">diskCache</a> on the shared disk queue.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>@property (readonly) NSUInteger diskByteCount</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">TMCache.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/diskCache" title="diskCache"></a>
	<h3 class="subsubtitle method-title">diskCache</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>The underlying disk cache, see <a href="../Classes/TMDiskCache.html">TMDiskCache</a> for additional configuration and trimming options.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>@property (readonly) TMDiskCache *diskCache</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">TMCache.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/memoryCache" title="memoryCache"></a>
	<h3 class="subsubtitle method-title">memoryCache</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>The underlying memory cache, see <a href="../Classes/TMMemoryCache.html">TMMemoryCache</a> for additional configuration and trimming options.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>@property (readonly) TMMemoryCache *memoryCache</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">TMCache.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/name" title="name"></a>
	<h3 class="subsubtitle method-title">name</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>The name of this cache, used to create the <a href="#//api/name/diskCache">diskCache</a> and also appearing in stack traces.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>@property (readonly) NSString *name</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">TMCache.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/queue" title="queue"></a>
	<h3 class="subsubtitle method-title">queue</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>A concurrent queue on which blocks passed to the asynchronous access methods are run.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>@property (readonly) dispatch_queue_t queue</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">TMCache.h</code><br />
	</div>				
	
	
</div>
						
					</div>
					
					
					
					
					
					<div class="section section-methods">
						<a title="Instance Methods" name="instance_methods"></a>
						<h2 class="subtitle subtitle-methods">Instance Methods</h2>
						
						<div class="section-method">
	<a name="//api/name/initWithName:" title="initWithName:"></a>
	<h3 class="subsubtitle method-title">initWithName:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>The designated initializer. Multiple instances with the same name are allowed and can safely access
the same data on disk thanks to the magic of seriality. Also used to create the <a href="#//api/name/diskCache">diskCache</a>.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (instancetype)initWithName:(NSString *)<em>name</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>name</em></dt>
			<dd><p>The name of the cache.</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>A new cache with the specified name.</p>
	</div>
	
	
	
	
	
	
	
	
	
	<div class="method-subsection see-also-section">
		<h4 class="method-subtitle">See Also</h4>
		<ul>
			
			<li><code><p><a href="#//api/name/name">@property name</a></p></code></li>
			
		</ul>
	</div>
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">TMCache.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/objectForKey:" title="objectForKey:"></a>
	<h3 class="subsubtitle method-title">objectForKey:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Retrieves the object for the specified key. This method blocks the calling thread until the object is available.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (id)objectForKey:(NSString *)<em>key</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>key</em></dt>
			<dd><p>The key associated with the object.</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>The object for the specified key.</p>
	</div>
	
	
	
	
	
	
	
	
	
	<div class="method-subsection see-also-section">
		<h4 class="method-subtitle">See Also</h4>
		<ul>
			
			<li><code><p><a href="#//api/name/objectForKey:block:">&ndash; objectForKey:block:</a></p></code></li>
			
		</ul>
	</div>
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">TMCache.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/objectForKey:block:" title="objectForKey:block:"></a>
	<h3 class="subsubtitle method-title">objectForKey:block:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Retrieves the object for the specified key. This method returns immediately and executes the passed
block after the object is available, potentially in parallel with other blocks on the <a href="#//api/name/queue">queue</a>.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)objectForKey:(NSString *)<em>key</em> block:(TMCacheObjectBlock)<em>block</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>key</em></dt>
			<dd><p>The key associated with the requested object.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>block</em></dt>
			<dd><p>A block to be executed concurrently when the object is available.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">TMCache.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/removeAllObjects" title="removeAllObjects"></a>
	<h3 class="subsubtitle method-title">removeAllObjects</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Removes all objects from the cache. This method blocks the calling thread until the cache has been cleared.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)removeAllObjects</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">TMCache.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/removeAllObjects:" title="removeAllObjects:"></a>
	<h3 class="subsubtitle method-title">removeAllObjects:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Removes all objects from the cache.This method returns immediately and executes the passed block after the
cache has been cleared, potentially in parallel with other blocks on the <a href="#//api/name/queue">queue</a>.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)removeAllObjects:(TMCacheBlock)<em>block</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>block</em></dt>
			<dd><p>A block to be executed concurrently after the cache has been cleared, or nil.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">TMCache.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/removeObjectForKey:" title="removeObjectForKey:"></a>
	<h3 class="subsubtitle method-title">removeObjectForKey:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Removes the object for the specified key. This method blocks the calling thread until the object
has been removed.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)removeObjectForKey:(NSString *)<em>key</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>key</em></dt>
			<dd><p>The key associated with the object to be removed.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">TMCache.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/removeObjectForKey:block:" title="removeObjectForKey:block:"></a>
	<h3 class="subsubtitle method-title">removeObjectForKey:block:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Removes the object for the specified key. This method returns immediately and executes the passed
block after the object has been removed, potentially in parallel with other blocks on the <a href="#//api/name/queue">queue</a>.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)removeObjectForKey:(NSString *)<em>key</em> block:(TMCacheObjectBlock)<em>block</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>key</em></dt>
			<dd><p>The key associated with the object to be removed.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>block</em></dt>
			<dd><p>A block to be executed concurrently after the object has been removed, or nil.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">TMCache.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/setObject:forKey:" title="setObject:forKey:"></a>
	<h3 class="subsubtitle method-title">setObject:forKey:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Stores an object in the cache for the specified key. This method blocks the calling thread until the object has been set.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)setObject:(id&lt;NSCoding&gt;)<em>object</em> forKey:(NSString *)<em>key</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>object</em></dt>
			<dd><p>An object to store in the cache.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>key</em></dt>
			<dd><p>A key to associate with the object. This string will be copied.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection see-also-section">
		<h4 class="method-subtitle">See Also</h4>
		<ul>
			
			<li><code><p><a href="#//api/name/setObject:forKey:block:">&ndash; setObject:forKey:block:</a></p></code></li>
			
		</ul>
	</div>
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">TMCache.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/setObject:forKey:block:" title="setObject:forKey:block:"></a>
	<h3 class="subsubtitle method-title">setObject:forKey:block:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Stores an object in the cache for the specified key. This method returns immediately and executes the
passed block after the object has been stored, potentially in parallel with other blocks on the <a href="#//api/name/queue">queue</a>.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)setObject:(id&lt;NSCoding&gt;)<em>object</em> forKey:(NSString *)<em>key</em> block:(TMCacheObjectBlock)<em>block</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>object</em></dt>
			<dd><p>An object to store in the cache.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>key</em></dt>
			<dd><p>A key to associate with the object. This string will be copied.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>block</em></dt>
			<dd><p>A block to be executed concurrently after the object has been stored, or nil.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">TMCache.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/sharedCache" title="sharedCache"></a>
	<h3 class="subsubtitle method-title">sharedCache</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>A shared cache.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (instancetype)sharedCache</code></div>

    
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>The shared singleton cache instance.</p>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">TMCache.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/trimToDate:" title="trimToDate:"></a>
	<h3 class="subsubtitle method-title">trimToDate:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Removes all objects from the cache that have not been used since the specified date.
This method blocks the calling thread until the cache has been trimmed.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)trimToDate:(NSDate *)<em>date</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>date</em></dt>
			<dd><p>Objects that haven&rsquo;t been accessed since this date are removed from the cache.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">TMCache.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/trimToDate:block:" title="trimToDate:block:"></a>
	<h3 class="subsubtitle method-title">trimToDate:block:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Removes all objects from the cache that have not been used since the specified date. This method returns immediately and
executes the passed block after the cache has been trimmed, potentially in parallel with other blocks on the <a href="#//api/name/queue">queue</a>.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)trimToDate:(NSDate *)<em>date</em> block:(TMCacheBlock)<em>block</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>date</em></dt>
			<dd><p>Objects that haven&rsquo;t been accessed since this date are removed from the cache.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>block</em></dt>
			<dd><p>A block to be executed concurrently after the cache has been trimmed, or nil.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">TMCache.h</code><br />
	</div>				
	
	
</div>
						
					</div>
					
					
				</div>
				<div class="main-navigation navigation-bottom">
					<ul>
	<li><a href="../index.html">Index</a></li>
	<li><a href="../hierarchy.html">Hierarchy</a></li>
</ul>
				</div>
				<div id="footer">
					<hr />
					<div class="footer-copyright">
						<p><span class="copyright">&copy; 2013 Tumblr. All rights reserved. (Last updated: 2013-05-24)</span><br />
						
						<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.1 (build 840)</a>.</span></p>
						
					</div>
				</div>
			</div>
		</article>
		<script type="text/javascript">
			function jumpToChange()
			{
				window.location.hash = this.options[this.selectedIndex].value;
			}
			
			function toggleTOC()
			{
				var contents = document.getElementById('contents');
				var tocContainer = document.getElementById('tocContainer');
				
				if (this.getAttribute('class') == 'open')
				{
					this.setAttribute('class', '');
					contents.setAttribute('class', '');
					tocContainer.setAttribute('class', '');
					
					window.name = "hideTOC";
				}
				else
				{
					this.setAttribute('class', 'open');
					contents.setAttribute('class', 'isShowingTOC');
					tocContainer.setAttribute('class', 'isShowingTOC');
					
					window.name = "";
				}
				return false;
			}
			
			function toggleTOCEntryChildren(e)
			{
				e.stopPropagation();
				var currentClass = this.getAttribute('class');
				if (currentClass == 'children') {
					this.setAttribute('class', 'children open');
				}
				else if (currentClass == 'children open') {
					this.setAttribute('class', 'children');
				}
				return false;
			}
			
			function tocEntryClick(e)
			{
				e.stopPropagation();
				return true;
			}
			
			function init()
			{
				var selectElement = document.getElementById('jumpTo');
				selectElement.addEventListener('change', jumpToChange, false);
				
				var tocButton = document.getElementById('table_of_contents');
				tocButton.addEventListener('click', toggleTOC, false);
				
				var taskTreeItem = document.getElementById('task_treeitem');
				if (taskTreeItem.getElementsByTagName('li').length > 0)
				{
					taskTreeItem.setAttribute('class', 'children');
					taskTreeItem.firstChild.setAttribute('class', 'disclosure');
				}
				
				var tocList = document.getElementById('toc');
				
				var tocEntries = tocList.getElementsByTagName('li');
				for (var i = 0; i < tocEntries.length; i++) {
					tocEntries[i].addEventListener('click', toggleTOCEntryChildren, false);
				}
				
				var tocLinks = tocList.getElementsByTagName('a');
				for (var i = 0; i < tocLinks.length; i++) {
					tocLinks[i].addEventListener('click', tocEntryClick, false);
				}
				
				if (window.name == "hideTOC") {
					toggleTOC.call(tocButton);
				}
			}
			
			window.onload = init;
			
			// If showing in Xcode, hide the TOC and Header
			if (navigator.userAgent.match(/xcode/i)) {
				document.getElementById("contents").className = "hideInXcode"
				document.getElementById("tocContainer").className = "hideInXcode"
				document.getElementById("top_header").className = "hideInXcode"
			}
			
		</script>
	</body>
</html>